﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace JuegoBomberman.Menu
{
    public class MenuGameOver : MenuManager
    {
        private Texture2D fondo;

        public MenuGameOver(JuegoBomberman game)
            : base(game)
        {
            this.colorElegido = Color.Tomato;
            this.colorNormal = Color.White;
        }

        public override void LoadContent()
        {
            base.LoadContent();

            SpriteFont fuente = content.Load<SpriteFont>("Imagenes/Menu/menufont");
            this.fondo = content.Load<Texture2D>("Imagenes/Menu/gameOver");

            this.itemsMenu.Add(new MenuItem("Menu Principal", new Vector2(20, 230), fuente, colorElegido, colorNormal));
            this.itemsMenu.Add(new MenuItem("Salir", new Vector2(70, 300), fuente, colorElegido, colorNormal));

            this.itemElegido = 0; 
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            //Limpio la pantalla
            game.GraphicsDevice.Clear(Color.Black);
            
            spriteBatch.Begin();
            this.spriteBatch.Draw(fondo, new Vector2(0, 0), Color.White);
            base.Draw(gameTime);
            spriteBatch.End();
        }

        public override void CambiarPantalla()
        {
            base.CambiarPantalla();

            switch (itemElegido){
                case 0:
                    this.game.MostrarMenuPrincipal();
                    break;
                case 1:
                    this.game.Exit();
                    break;
            }

        }
    }
}
